/**
 * 
 */
package com.googlecode.simplexer.io.implementation;

import java.io.*;

import com.googlecode.simplexer.io.*;

/**
 * @author Administrator
 *
 */
public class FileCharOutputSequence implements CharOutputSequence {

	protected PrintStream printStream = null;
	
	protected FileCharOutputSequence() {
		
	}
	
	public FileCharOutputSequence(String fileName) throws IOException {
		this.printStream = new PrintStream(fileName);
	}
	
	public FileCharOutputSequence(PrintStream ps) throws IOException {
		this.printStream = ps;
	}
	
	/* (non-Javadoc)
	 * @see net.sourceforge.simplexer.io.StringStream#append(char)
	 */
	public void append(char chr) {
		printStream.append(chr);
	}

	/* (non-Javadoc)
	 * @see net.sourceforge.simplexer.io.StringStream#append(java.lang.String)
	 */
	public void append(String stream) {
		printStream.append(stream);
	}
	
	public String toString(){
		return printStream.toString();
	}

	public void close() {
		printStream.close();
	}

}
